SCS Sensor Configuration Editor

Custom / User-Defined Calculated Expressions

When creating a new calculated item SCS allows you to choose from a predefined set of canned functions or create your own custom expression.  This choice cannot be changed once created.  If you choose to create a custom expression then you can generate a very simple or extremely complex function to take whatever source data you want, manipulate it and output your desired results.  
 

When ACQ outputs a calculated message it formats it similar to a NMEA string.  This means it starts with a sentence label ($DERIV) followed by its comma delimited data with a line feed control character at the end.  

It is recommended you use the Pre-Programmed functions if they meet your requirement instead of defining your own.

Integration with R and other external tooling has not been included in this release of SCS.  You can only use the SCS expression builder and the limitations therein.

 

The Basic tab consists of the following fields:

 

The Advanced tab consists of the following fields:

 

 

 

Custom Equation Editor

The Custom Equation editor is where you supply the expression you wish to execute to take the source data and build your output data. 

 

It is recommended you:

  1. Determine the formula you wish to execute in order to be aware of the source data you will need. 
  2. Build Calculation Parameters for each source field and assign it a unique and descriptive Friendly Name
  3. Start typing out your formula into the equation editor combining appropriate mathematical functions and the variables you defined in step 2.
  4. Tailor your result data fields

 

 

For example, to convert a temperature from Celsius to Fahrenheit:

Determine the formula: 

(0°C × 9/5) + 32 = 32°F

 

Build parameters:

Only need a single source data item, a data field with a temperature reading in units of Celsius.

 

Build Formula

The custom equation editor allows the user to enter an algebraic expression out of user-defined variable names and system-defined constants and mathematical functions.  This pseudo-code is compiled by the ACQ Service to be a resultant derived data field value. The expression is entirely what would appear on the right side of the equals (=) sign.  The expression must contain only a single line.  The algebraic expressions allow for addition (+), subtraction (-), multiplication (*) and division (/), and follow the rules for order of operations. The user-defined variables names, or friendly names, are forced to be lowercase.  The system-defined constants and functions are all uppercase.  Given the friendly name variables and the provided functions and constants, the expression should otherwise follow the syntax the C# programming language.

 

As you start typing the editor will highlight and attempt to assist you with your equation.  If you start typing the friendly name of one of your source fields it will display the list for you to choose from and highlight them in green. When you end a scope the parenthesis will be highlight in yellow showing you whats inside.  Math functions will also be displayed for you to choose from, many are the standard set you would find in Microsoft Excel.

 

 

As another example, consider the following custom equation that calculates the air pressure at sea level, given a sensor at 10 m above sea level.  The expression, which is already a pre-programmed function available in CFE, is only to illustrate that mathematical operators.

Tailor Output Data Fields

Once your equation is complete proceed to the automatically created data fields (the outputs) for this interface. 

Name appropriately and be sure to select the correct category and units!

 

 

 

 

SCSv5                                                                                                        Page 1 of 1